import 'package:flutter/material.dart';
import 'package:get/get.dart';

class HomeController extends GetxController {
  var tabs = [
    Tab(text: '资讯'),
    Tab(text: '技术'),
  ];

  var tabBarView = [
    Container(
      child: ListView.builder(
        itemBuilder: (BuildContext context, int index) {
          return Container(
            height: 80,
            color: Colors.primaries[index % Colors.primaries.length],
            alignment: Alignment.center,
            child: Text(
              '$index',
              style: TextStyle(color: Colors.lightBlue, fontSize: 20),
            ),
          );
        },
        padding: EdgeInsets.zero,
        itemCount: 20,
      ),
    ),
    Container(
      child: Text("2222"),
    )
  ];
  final selectedIndex = 0.obs;

  ///页面控制器
  PageController pageController = PageController();

  onTap(index) {
    selectedIndex.value = index;
  }
}
